From: Richard M. Stallman Date: Sun, 13 Jun 1993 01:36:48 +0000 (+0000) Subject: (finder-find-library): New function. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~95352 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=d90f825cd859f9593dd19a0933e0f7a8bb317d3c;p=emacs.git (finder-find-library): New function. (finder-commentary): Use it. --- diff --git a/lisp/finder.el b/lisp/finder.el index 41e67723dde..44df466d7c6 100644 --- a/lisp/finder.el +++ b/lisp/finder.el @@ -187,9 +187,23 @@ arguments compiles from `load-path'." (shrink-window-if-larger-than-buffer) (finder-summary))) +;; Search for a file named FILE the same way `load' would search. +(defun finder-find-library (file) + (if (file-name-absolute-p file) + file + (let ((dirs load-path) + found) + (while (and dirs (not found)) + (if (file-exists-p (expand-file-name (concat file ".el") (car dirs))) + (setq found (expand-file-name file (car dirs))) + (if (file-exists-p (expand-file-name file (car dirs))) + (setq found (expand-file-name file (car dirs))))) + (setq dirs (cdr dirs))) + found))) + (defun finder-commentary (file) (interactive) - (let* ((str (lm-commentary file))) + (let* ((str (lm-commentary (finder-find-library file)))) (if (null str) (error "Can't find any Commentary section.")) (pop-to-buffer "*Finder*")